package 数据结构和算法入门计划8月开始;
// https://leetcode-cn.com/problems/ransom-note/
public class 赎金信3830820 {
    class Solution {
        public boolean canConstruct(String ransomNote, String magazine) {
            int a[] = new int[26];
            int b[] = new int[26];
            char aa[] = ransomNote.toCharArray();
            char bb[] = magazine.toCharArray();
            for(char c : aa) a[c-'a']++;
            for(char c : bb) b[c-'a']++;
            for(int i = 0;i < 26;i++){
                if(a[i] > b[i]) return false;
            }
            return true;
        }
    }

}
